package pl.kedziorski.timesurvey;

import java.util.Date;

public class Survey {
	private long time = 0L;
	private Date start;
	private SurveyResultFormat format = SurveyResultFormat.SECONDS;
	
	Survey(){}
	
	Survey(SurveyResultFormat format){
		this.format  = format;
	}
	
	
	public void start(){
		start = new Date();
	}
	
	public void stop(){
		time += new Date().getTime() - start.getTime();
		start = null;
	}
	public void pause(){
		Date pauseTime = new Date();
		time = pauseTime.getTime() - start.getTime();
	}
	
	@Override
	public String toString(){
		return null;
		
	}
	
	public void print(){
		System.out.println(format.format(time));
	}

	public void clear(){
		time = 0L;
		start = null;
	}
}
